<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button id="backEle">返回</button>
    <button id="forwardEle">前进</button>
    <button id="goEle">去指定的记录</button>
    <button id="linkEle">跳转08</button>
    <script>
        console.log(history.length);

        backEle.onclick = function () {
            history.back();
        }

        forwardEle.onclick = function () {
            history.forward();
        }
        goEle.onclick = function () {
            history.go(-3);
        }

        linkEle.onclick = function () {
            history.pushState({ id: '100' }, '', "./08-history.html")
        }

    </script>
</body>

</html>